#ifndef VISWIDGETBASE_H
#define VISWIDGETBASE_H

#include "AmaranthusCommon.h"
#include "ImageCoordinateGeometry.h"

#include "vtkActor.h"
#include "vtkPolyData.h"
#include "vtkContourFilter.h"
#include "vtkPolyDataNormals.h"
#include "vtkPolyDataMapper.h"
#include "vtkSmartPointer.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkProperty.h"
#include "vtkProp3D.h"
#include "vtkGenericOpenGLRenderWindow.h"
#include "vtkRenderWindowInteractor.h"

#include <QMap>
#include <QVTKWidget2.h>

class VisWidgetBase : public QVTKWidget2
{
    Q_OBJECT

public:
    enum VisWidgetType { SLICER_AXIAL, SLICER_SAGITTAL, SLICER_CORONAL, VOLUME };

    typedef vtkSmartPointer<vtkPolyData> PolyDataPointer;

    typedef vtkSmartPointer<vtkCamera> CameraPointer;

    typedef vtkSmartPointer<vtkPolyDataMapper> PolyDataMapperPointer;
    typedef vtkSmartPointer<vtkRenderer> RendererPointer;
    typedef vtkSmartPointer<vtkActor> ActorPointer;

    typedef QMap<int, vtkProp3D*> ActorsMapType;

    typedef ImageCoordinateGeometry::TransformMatrixPointer TransformMatrixPointer;
    typedef ImageCoordinateGeometry::TransformMatrixType TransformMatrixType;

    VisWidgetBase(QWidget* parent = NULL);
    virtual ~VisWidgetBase();

    virtual void SetTransformMatrix(TransformMatrixType *transformMatrix)
    { m_TransformMatrix = transformMatrix; }

    void ShowVolume(int index);
    void HideVolume(int index);

    void Update();

protected:
    ActorsMapType *m_ActorsMap;

    PolyDataPointer m_PolyData;

    CameraPointer m_Camera;
    RendererPointer m_Renderer;

    VisWidgetType m_WidgetType;

    TransformMatrixPointer m_TransformMatrix;
};

#endif


